﻿/*
 * All data entities which are bounded with UI
 * 
 */

using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using CC98.Data;
using CC98.Metro.Controls;

namespace CC98.Metro.Data
{
    public class AccountDataItem
    {
        public bool IsLoggedIn { get; set; }

        public User User { get; set; }
    }

    public class ThreadDataItem
    {
        /// <summary>
        /// Thread index from 1
        /// </summary>
        public int Index { get; set; }
        /// <summary>
        /// For test only
        /// </summary>
        public string Name { get; set; }
    }

    public class Top10VariableSizeProvider : ISizeProvider
    {
        public VariableSize GetSize(object item)
        {
            ThreadDataItem threadDataItem = (ThreadDataItem)item;

            switch (threadDataItem.Index)
            {
                case 1:
                    return new VariableSize() { Column = 6, Row = 3 };

                case 2:
                    return new VariableSize() { Column = 4, Row = 2 };

                case 3:
                case 4:
                    return new VariableSize() { Column = 4, Row = 1 };

                default:
                    return new VariableSize() { Column = 2, Row = 1 };
            }
        }
    }

}
